// ignore_for_file: file_names

import 'package:flutter/material.dart';

class ListViewDemo1 extends StatelessWidget {
  const ListViewDemo1({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('ListView的基础使用'),
        backgroundColor: Colors.red,
      ),
      body: ListView(
        // 滚动效果：禁用滚动
        // physics: const NeverScrollableScrollPhysics(),
        // 滚动方向1：纵向滚动(默认的)
        scrollDirection: Axis.vertical,
        // 滚动方向2：横向滚动
        // scrollDirection: Axis.horizontal,
        children: [
          Container(
            height: 80,
            color: Colors.blue,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件1'),
          ),
          Container(
            height: 90,
            color: Colors.pink,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件2'),
          ),
          Container(
            height: 100,
            color: Colors.teal,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件3'),
          ),
          Container(
            height: 110,
            color: Colors.green,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件4'),
          ),
          Container(
            height: 120,
            color: Colors.cyan,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件5'),
          ),
          Container(
            height: 130,
            color: Colors.orange,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件6'),
          ),
          Container(
            height: 140,
            color: Colors.blue,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件7'),
          ),
          Container(
            height: 150,
            color: Colors.green,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件8'),
          ),
          Container(
            height: 160,
            color: Colors.brown,
            alignment: Alignment.centerLeft,
            child: const Text('鸿蒙大事件9'),
          ),
        ],
      ),
    );
  }
}
